<html>
<head><meta charset="utf-8"><title>Improving an unit related error message · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Improving.20an.20unit.20related.20error.20message.html">Improving an unit related error message</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204919609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Improving%20an%20unit%20related%20error%20message/near/204919609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guillaume Valadon <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Improving.20an.20unit.20related.20error.20message.html#204919609">(Jul 24 2020 at 14:09)</a>:</h4>
<h1>I have been redirected here from the Discord #rust-usage channel</h1>
<p>Hi. I have a question regarding an error message from the compiler. I made a mistake an added a semicolon after a function call inside an unsafe block (as in <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=c77daa3cc023d02f8b7353a581ffe527">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=c77daa3cc023d02f8b7353a581ffe527</a>). Do you think that there is a way to modify rustc to return a more meaningful message? I am willing to work on the fix, if this could be relevant.</p>



<a name="204919899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Improving%20an%20unit%20related%20error%20message/near/204919899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Improving.20an.20unit.20related.20error.20message.html#204919899">(Jul 24 2020 at 14:12)</a>:</h4>
<p>We have a "Consider removing this semicolon" suggestion when this happens with the last expression in a function, perhaps that could be extended to cover more cases?</p>



<a name="204920040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Improving%20an%20unit%20related%20error%20message/near/204920040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guillaume Valadon <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Improving.20an.20unit.20related.20error.20message.html#204920040">(Jul 24 2020 at 14:12)</a>:</h4>
<p>That sounds like a good idea.</p>



<a name="204920255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Improving%20an%20unit%20related%20error%20message/near/204920255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guillaume Valadon <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Improving.20an.20unit.20related.20error.20message.html#204920255">(Jul 24 2020 at 14:14)</a>:</h4>
<p>I will have a look</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>